<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:p="http://jboss.com/products/seam/pdf"
	template="layout/template.xhtml">

	<ui:define name="body">
		
		<h:messages globalOnly="true" styleClass="message" errorClass="errormsg" infoClass="infomsg" warnClass="warnmsg" id="globalMessages"/>
		
		<rich:panel>
			<f:facet name="header">Round</f:facet>

			<s:decorate id="golfer" template="layout/display.xhtml">
					<ui:define name="label">Golfer</ui:define>
					<s:link view="/profile.xhtml">
						<f:param name="golferId" value="#{round.golfer.id}"/>
						#{round.golfer.name}
					</s:link>
			</s:decorate>

			<s:decorate id="name" template="layout/display.xhtml">
					<ui:define name="label">Date</ui:define>
					<h:outputText value="#{round.date}">
						<s:convertDateTime type="date" />
					</h:outputText>
			</s:decorate>

			<s:decorate id="totalScore" template="layout/display.xhtml">
					<ui:define name="label">Total score</ui:define>
					#{round.totalScore}
			</s:decorate>

			<s:decorate id="weather" template="layout/display.xhtml">
					<ui:define name="label">Weather</ui:define>
					#{round.weather}
			</s:decorate>

			<s:decorate id="notes" template="layout/display.xhtml">
					<ui:define name="label">Notes</ui:define>
					#{round.notes}
			</s:decorate>

			<div style="clear:both"/>
		</rich:panel>
		
		<div class="actionButtons">
			<s:button id="edit" view="/RoundEdit.xhtml" value="Edit"/>
			<s:button id="done" view="/#{empty roundFrom ? 'RoundList' : roundFrom}.xhtml" value="Done"/>
		</div>

		<rich:tabPanel switchType="ajax">

			<rich:tab label="Tee set">
				<div class="association" id="teeSetParent">
				
					<h:outputText value="No tee set" rendered="#{round.teeSet == null}"/>

					<rich:dataTable id="teeSetTable" var="teeSet" value="#{round.teeSet}"
						rendered="#{round.teeSet != null}" rowClasses="rvgRowOne,rvgRowTwo">
						<h:column>
								<f:facet name="header">id</f:facet>
								#{teeSet.id}
						</h:column>
						<h:column>
								<f:facet name="header">Name</f:facet>
								#{teeSet.name}
						</h:column>
						<h:column>
								<f:facet name="header">Course</f:facet>
								#{teeSet.course.name}
						</h:column>
						<h:column>
								<f:facet name="header">Color</f:facet>
								<div title="#{teeSet.color}" class="colorSwatch" style="background-color: #{teeSet.color};" />
						</h:column>
						<h:column>
								<f:facet name="header">Course/Slope Rating (Men)</f:facet>
								#{teeSet.mensCourseRating} / #{teeSet.mensSlopeRating}
						</h:column>
						<h:column>
								<f:facet name="header">Course/Slope Rating (Ladies)</f:facet>
								#{teeSet.ladiesCourseRating} / #{teeSet.ladiesSlopeRating}
						</h:column>
						<h:column>
								<f:facet name="header">Position</f:facet>
								#{teeSet.position}
						</h:column>
						<h:column>
							<f:facet name="header">action</f:facet>
							<s:link id="viewteeSet" value="View" view="/TeeSet.xhtml">
								<f:param name="teeSetId" value="#{teeSet.id}"/>
							</s:link>
						</h:column>
					</rich:dataTable>
				</div>
			</rich:tab>

		</rich:tabPanel>

	</ui:define>

</ui:composition>
